//
//  WJNewViewController.m
//  BeDeJie
//
//  Created by jerry on 2017/1/25.
//  Copyright © 2017年 jerry. All rights reserved.
//

#import "WJNewViewController.h"
#import "WJSubTagViewController.h"

@interface WJNewViewController ()

@end

@implementation WJNewViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //设置背景色
    self.view.backgroundColor = WJColor(206, 206, 206);
    
    //设置导航条
    [self setupNavBar];
    
    //监控tabBar重复点击的通知
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(tabBarButtonDidRepeatClick) name:WJTabBarButtonDidRepeatClickNotification object:nil];
}

- (void)dealloc{
    //清除通知
    [[NSNotificationCenter defaultCenter] removeObserver:self];
}

#pragma mark - 监听
// 监听tabBarButton重复点击
- (void)tabBarButtonDidRepeatClick{
    //若控制器没有添加到窗体，则返回
    if (self.view.window == nil) return;
    
    WJFunc;
}
-(void)setupNavBar {
    //左边的按钮
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem
                                             itemWithImage:[UIImage imageNamed:@"icon_navbar_tag_sub_normal"]
                                             highImage:[UIImage imageNamed:@"icon_navbar_tag_sub_selected"]
                                             target:self
                                             action:@selector(tagSub)];
    
    //中间的标题
    self.navigationItem.title = @"新帖";
}

-(void)tagSub{
    WJSubTagViewController *subTagController = [[WJSubTagViewController alloc] init];
    [self.navigationController pushViewController:subTagController animated:YES];
}

@end
